package com.ty.day3;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : txy
 * @Create 2023/10/30 15:31
 */
public class Eight {
    public static void main(String[] args) {
        int a = 1, b = 1;
        for (int i = 0; i < 4; i++) {
            a = a + b;
            b = a + b;
        }
        System.out.println(2 * b);
        int c = 0;
        for (int i = 0; i < 10; i++) {
            if (i == 0) {
                a = 1;
            } else if (i == 1) {
                b = 1;
            } else {
                c = a + b;
                a = b;
                b = c;
            }
        }
        System.out.println(2 * c);
        System.out.println(2 * func(10));
    }

    public static long func(int a) {
        if (a == 1 || a == 2) {
            return 1;
        }
        return func(a - 1) + func(a - 2);
    }
}
